import Vue from 'vue'
import App from './App.vue'
//引入路由
import router from './router'
import store from './store'
//引入Mock
import './mock/mockServe'
//引入swiper
import VueAwesomeSwiper from 'vue-awesome-swiper'

// 引入 swiper
import 'swiper/css/swiper.css'

Vue.use(VueAwesomeSwiper, /* { default options with global component } */)
//三级联动组件
// import TypeNav from './components/TypeNav'
//第一个参数：全局组件的名字 第二个参数：组件
import Carousel from './components/Carousel'
import Pagination from './components/Pagination/Pagination.vue'
import { Button, MessageBox } from 'element-ui'
// 引入懒加载
import VueLazyload from 'vue-lazyload'
// 懒加载图片
import lazy from './assets/lazy.jpg'
// 统一引入api所有接口
import * as API from '@/api'
// 引入vee插件
import './plugins/validate'
import MyPlugin from './plugins/myPlugin';
Vue.use(MyPlugin, {
    name: '',
})

// 注册组件
// Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name, Pagination)
Vue.use(Button)

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.config.productionTip = false
Vue.use(VueLazyload, {
    loading: lazy
})
new Vue({
    //注册路由
    render: h => h(App),
    // 全局事件总线
    beforeCreate() {
        Vue.prototype.$bus = this;
        Vue.prototype.$API = API;
    },
    router,
    store
}).$mount('#app')